<!DOCTYPE html>
<!--suppress ALL-->
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>部门管理</title>
    <div th:replace="views/common/link :: link"></div>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
    <div th:replace="views/common/navbar :: navbar"></div>

    <!--菜单回显-->
    <div th:replace="views/common/menu :: menu"></div>
    <div class="content-wrapper">
        <section class="content-header">
            <h1>部门管理</h1>
        </section>
        <section class="content">
            <div class="box" style="padding: 10px">
                <!--高级查询--->
                <form class="form-inline" id="searchForm" action="#" method="post">
                    <input type="hidden" name="currentPage" id="currentPage" value="1">
                    <div class="form-group">
                        <label for="keyword">关键字:</label>
                        <input type="text" class="form-control" id="keyword" name="keyword"  placeholder="请输入姓名/邮箱">
                    </div>
                    <div class="form-group">
                        <label for="dept">部门:</label>
                        <select class="form-control" id="dept" name="dept">
                            <option value="-1">全部</option>
                            <option th:each="department:${departments}" th:value="${department.id}" th:text="${department.name}">全部</option>

                        </select>

                    </div>
                    <button id="btn_query" class="btn btn-default" type="button">查询</button>
                    <a shiro:hasPermission="employee:input" href="/employee/input" class="btn btn-success">添加</a>
                </form>
                <!--编写内容-->
                <div class="box-body table-responsive no-padding ">
                    <table class="table table-striped table-hover" >
                        <thead>
                        <tr>
                            <th>编号</th>
                            <th>名称</th>
                            <th>email</th>
                            <th>年龄</th>
                            <th>部门</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tr th:each="employee,employeeStat:${pageInfo.list}">
                            <input type="hidden" th:value="${employee.admin}">
                            <td th:text="${employee.id}">1</td>
                            <td th:text="${employee.name}">admin</td>
                            <td th:text="${employee.email}">admin@abc.com</td>
                            <td th:text="${employee.age}">20</td>
                            <td th:text="${departmentList.get(employeeStat.index).name}">人力资源部</td>
                            <td>
                                <a shiro:hasPermission="employee:input" class="btn btn-info btn-xs btn_redirect" href="/employee/input"
                                   th:href="@{'/employee/input?id='+${employee.id}}">
                                    <span class="glyphicon glyphicon-pencil"></span> 编辑
                                </a>
                                <a shiro:hasPermission="employee:delete" th:href="@{'/employee/delete/'+${employee.id}}" class="btn btn-danger btn-xs" th:value="${employee.id}"  onclick="del(this);return false;">
                                    <span class="glyphicon glyphicon-trash"></span> 删除
                                </a>
                            </td>
                        </tr>

                    </table>
                    <!--分页-->
                    <div th:replace="views/common/page_plus :: page_plus(pageInfo=${pageInfo})"></div>

                </div>
            </div>
        </section>
    </div>
    <div th:replace="views/common/footer :: footer"></div>
    </div>
</body>
</html>
